package top.ccm.ems.system.controller;

import org.springframework.web.bind.annotation.*;
import top.ccm.ems.system.pojo.R;

/**
 * @Authur ccm
 */
@RestController
@RequestMapping("/ems/user")
@CrossOrigin
public class LoginController {
    @PostMapping("login")
    public R login() {
        return R.ok().data("token","admin");
    }
    @GetMapping("info")
    public R info() {
        return  R.ok().data("roles","[admin]").data("name","admin").data("avatar","https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimage.uczzd.cn%2F10400559552116610774.jpg%3Fid%3D0&refer=http%3A%2F%2Fimage.uczzd.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1640347186&t=0ac9dec575f8c7f7abe7739d4fa4d59c");
    }
    @PostMapping("logout")
    public R logout() {
        return R.ok();
    }
}
